package com.grandbroad.eim.base;

import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.grandbroad.eim.R;
import com.grandbroad.eim.utils.UiUtlis;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;

public abstract class BaseRecyclerview extends BaseFragment {
    @BindView(R.id.recycler_view)
    RecyclerView recyclerView;
    @BindView(R.id.base_recyclerview)
    public SwipeRefreshLayout baseRecyclerview;
    Unbinder unbinder;
    @BindView(R.id.img_user_commeon_avator)
    ImageView imgUserCommeonAvator;
    @BindView(R.id.edit_chat)
    EditText editChat;
    @BindView(R.id.li_chat_layout)
    LinearLayout liChatLayout;
    Unbinder unbinder1;

    @Override
    protected boolean setEventOpen() {
        return false;
    }

    @Override
    protected void initdata() {
        loadData();
    }

    protected abstract void initRecyclerview(RecyclerView recyclerView);


    protected abstract void loadData();

    protected void configChatorComment(LinearLayout linearLayout,EditText editText,ImageView avator)
    {

    }


    @Override
    protected void initview() {
        baseRecyclerview.setColorSchemeColors(UiUtlis.getColor(R.color.TextFont));
        initRecyclerview(recyclerView);
        configChatorComment(liChatLayout,editChat,imgUserCommeonAvator);

    }

    @Override
    protected int setlayout() {
        return R.layout.fragment_recyclerview;
    }

    protected void stopRefresh() {
        baseRecyclerview.setRefreshing(false);
    }

    protected void startRefrsh()
    {
        baseRecyclerview.setRefreshing(true);
    }

}
